﻿using QunProject.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QunProject.Interface
{
    public interface IServer
    {
        #region 系统接口

        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="phone">手机号码</param>
        /// <param name="code">验证码</param>
        /// <param name="type">类型[特殊用途使用]</param>
        /// <returns></returns>
        Common.Result SendSmsResult(string phone, string code, int? type);

        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="type">上传类型枚举</param>
        /// <param name="base64">base64字符串</param>
        /// <returns></returns>
        Common.Result FileUpload(int type = (int)FileHelper.FileTypes.不限制, string base64 = "");

        #endregion

        #region 登录系统

        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="phone">手机号码</param>
        /// <param name="passWord">密码</param>
        /// <param name="smsCode">短信验证码</param>
        /// <returns></returns>
        Common.Result UserInsertResult(string phone, string passWord, string smsCode);

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="phone">手机号码</param>
        /// <param name="passWord">密码</param>
        /// <param name="smsCode">短信验证码</param>
        /// <returns></returns>
        Common.Result UserLoginResult(string phone, string passWord = "", string smsCode = "");

        /// <summary>
        /// 获取用户登录信息
        /// </summary>
        /// <returns></returns>
        Common.Result UserLoginInfoResult();

        /// <summary>
        /// 用户找回密码
        /// </summary>
        /// <param name="phone">手机号码</param>
        /// <param name="passWord">密码</param>
        /// <param name="smsCode">短信验证码</param>
        /// <returns></returns>
        Common.Result UserBackPasswordResult(string phone, string passWord, string smsCode);

        /// <summary>
        /// 注销登录
        /// </summary>
        /// <returns></returns>
        Common.Result UserLoginOut();

        #endregion

        #region 基础数据

        /// <summary>
        /// 清除缓存
        /// </summary>
        /// <returns></returns>
        Common.Result ClearCache();

        /// <summary>
        /// 获取站点首页数据
        /// </summary>
        /// <returns></returns>
        Common.Result GetHomeIndexResult();

        /// <summary>
        /// 获取推荐文章
        /// </summary>
        /// <param name="ClassifyId">知识分类ID</param>
        /// <returns></returns>
        Common.Result GetHotArticleResult();

        /// <summary>
        /// 获取技术讨论文章
        /// </summary>
        /// <param name="discussId">技术讨论ID</param>
        /// <returns></returns>
        Common.Result GetHotDiscussResult();

        /// <summary>
        /// 获取友情链接
        /// </summary>
        /// <returns></returns>
        Common.Result GetFriendHrefResult();

        /// <summary>
        /// 获取所有知识分类
        /// </summary>
        /// <returns></returns>
        Common.Result GetClassifyResult();

        #endregion

        #region 文章

        /// <summary>
        /// 获取文章列表
        /// </summary>
        /// <param name="classifyId">知识分类ID</param>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetArticleListResult(int? classifyId, int page = 1, int limit = 10);

        /// <summary>
        /// 获取文章实体
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <param name="password">文章密码</param>
        /// <returns></returns>
        Common.Result GetArticleResult(int articleId, string password = "");

        /// <summary>
        /// 获取SEO文章实体
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <returns></returns>
        Common.Result GetArticleSeoResult(int articleId);

        /// <summary>
        /// 检测文章密码
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <returns></returns>
        Common.Result GetTestArticlePassResult(int articleId);

        /// <summary>
        /// 获取技术讨论列表
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetDiscussListResult(int page = 1, int limit = 10);

        /// <summary>
        /// 点赞/踩
        /// </summary>
        /// <param name="type">类型 1|点赞 其他|踩</param>
        /// <param name="articleId">文章ID</param>
        /// <returns></returns>
        Common.Result EditArticlePraiseCriticismResult(int type, int articleId);

        #endregion

        #region 评论

        /// <summary>
        /// 评论一个文章或回复某人
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <param name="replyId">回复ID（回复某人）</param>
        /// <param name="content">内容</param>
        /// <returns></returns>
        Common.Result EditReplyResult(int articleId, int? replyId, string content);

        /// <summary>
        /// 点赞/踩
        /// </summary>
        /// <param name="type">类型 1|点赞 其他|踩</param>
        /// <param name="replyId">文章ID</param>
        /// <returns></returns>
        Common.Result EditReplyPraiseCriticismResult(int type, int replyId);

        /// <summary>
        /// 获取回复列表
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <param name="sort">排序 0|最新 1|最热</param>
        /// <returns></returns>
        Common.Result GetReplyListResult(int articleId, int page = 1, int limit = 10, int sort = 0);

        #endregion

        #region 专题

        /// <summary>
        /// 获取专题列表
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetSpecialListResult(int page = 1, int limit = 10);

        /// <summary>
        /// 获取专题文章列表
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <param name="specialId">专题ID</param>
        /// <returns></returns>
        Common.Result GetSpecialArticleListResult(int specialId, int page = 1, int limit = 10);

        /// <summary>
        /// 获取热门专题列表
        /// </summary>
        /// <returns></returns>
        Common.Result GetHotSpecialResult();

        #endregion

        #region 用户中心

        /// <summary>
        /// 获取个人中心数据
        /// </summary>
        /// <returns></returns>
        Common.Result GetMemberIndexResult();

        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="model">用户实体</param>
        /// <returns></returns>
        Common.Result UserEditInfoResult(Model.member model);

        /// <summary>
        /// 用户获取自己的文章
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetMemberArticleListResult(int page = 1, int limit = 10);

        /// <summary>
        /// 用户获取自己的专题
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetMemberSpecialListResult(int page = 1, int limit = 10);

        /// <summary>
        /// 用户获取自己的讨论
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetMemberDiscussListResult(int page = 1, int limit = 10);

        /// <summary>
        /// 用户获取自己的回复
        /// </summary>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetMemberReplyListResult(int page = 1, int limit = 10);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="pwd">旧密码</param>
        /// <param name="pwd1">新密码</param>
        /// <param name="pwd2">重复新密码</param>
        /// <returns></returns>
        Common.Result UserEditPasswordResult(string pwd = "", string pwd1 = "", string pwd2 = "");

        /// <summary>
        /// 编辑专题
        /// </summary>
        /// <param name="model">专题实体</param>
        /// <returns></returns>
        Common.Result UserEditSpecialResult(Model.special model);

        /// <summary>
        /// 编辑文章
        /// </summary>
        /// <param name="model">文章实体</param>
        /// <param name="resJson">资源Json</param>
        /// <returns></returns>
        Common.Result UserEditArticleResult(Model.article model, string resJson = "");

        /// <summary>
        /// 保存文章草稿
        /// </summary>
        /// <param name="model">文章实体</param>
        /// <param name="resJson">资源Json</param>
        /// <returns></returns>
        Common.Result UserEditArticleDraftResult(Model.article model, string resJson = "");

        /// <summary>
        /// 编辑讨论
        /// </summary>
        /// <param name="model">讨论实体</param>
        /// <returns></returns>
        Common.Result UserEditDiscussResult(Model.article model);

        /// <summary>
        /// 用户获取自己的一个文章
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <returns></returns>
        Common.Result GetMemberArticleResult(int articleId);

        /// <summary>
        /// 用户获取自己的一个专题
        /// </summary>
        /// <param name="specialId">专题ID</param>
        /// <returns></returns>
        Common.Result GetMemberSpecialResult(int specialId);

        /// <summary>
        /// 用户获取自己的一个讨论
        /// </summary>
        /// <param name="articleId">讨论ID</param>
        /// <returns></returns>
        Common.Result GetMemberDiscussResult(int articleId);

        /// <summary>
        /// 用户获取自己的一个专题文章列表
        /// </summary>
        /// <param name="specialId">专题ID</param>
        /// <param name="page">页索引</param>
        /// <param name="limit">页大小</param>
        /// <returns></returns>
        Common.Result GetMemberSpecialArticleResult(int specialId, int page = 1, int limit = 10);

        /// <summary>
        /// 用户删除自己的一个文章
        /// </summary>
        /// <param name="articleId">文章ID</param>
        /// <returns></returns>
        Common.Result DeleteMemberArticleResult(int articleId);

        /// <summary>
        /// 用户删除自己的一个专题
        /// </summary>
        /// <param name="specialId">专题ID</param>
        /// <returns></returns>
        Common.Result DeleteMemberSpecialResult(int specialId);

        #endregion

        #region 投诉

        /// <summary>
        /// 投诉
        /// </summary>
        /// <param name="type">投诉类型（枚举）</param>
        /// <param name="objId">被投诉对象ID</param>
        /// <param name="content">投诉内容</param>
        /// <returns></returns>
        Common.Result EditComplainResult(int type, int objId, string content);

        #endregion

        #region 用户首页

        ///// <summary>
        ///// 获取用户首页数据
        ///// </summary>
        ///// <param name="number">用户编号</param>
        ///// <returns></returns>
        //Common.Result GetMemberPageResult(string number);

        #endregion
    }
}
